

import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class LoadImagePage extends StatefulWidget{
  @override
  State<StatefulWidget> createState() => _LoadImageState();

}

class _LoadImageState extends State<LoadImagePage>{
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: AppBar(
        title: Text("图片练习"),
      ),
      body: Container(
        child: Row(
          children: [
            CachedNetworkImage(
              imageUrl: "http://via.placeholder.com/350x150",
              placeholder: (context, url) => CircularProgressIndicator(),
              errorWidget: (context, url, error) => Icon(Icons.error),
              width: 100,
              height: 200,
            ),
          ],
        ),
      ),
    );
  }

}